home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-02-09 | 1.2 KB | 35 lines | [TEXT/GEOL] |
- Item forwarded by BLANTON to AXELROD1
-
- Item 3541734 7-Feb-90 12:08PST
-
- From: WBJ Judd, William B
-
- To: CPLUS.APPLE$ C++ Interest List--Apple Employees
- CPLUS.DEV$ C++ Interest List--Developers
-
- Sub: Thanks for a Quick Answer!
-
- Thanks to John Dance for a quick answer to a perplexing problem!
-
- John writes:
-
- >Bill:
- >What you have run into is the difference in I/O models for Unix-like systems
- >and MPW. MPW uses "the current selection" as input into tools. When there is
- >no current selection, and you press enter, then the entire line is input into
- >the tool. So rather than reading just your typed value, cin was reading:
- >Input distance in miles: <your value>.
- >This caused some error conditions in cin that the program isn't checking for.
- >The fix is very simple. When you are doing input prompting in MPW, put out a
- >newline so that your input is always on a line by itself. In your program,
- >just change the input prompt line to:
- > cout << "Input distance in miles:\n";
- >Then everything will work as expected.
- >
- >John Dance
-
- Thanks to everyone who read & thought about my question.
-
- Bill Judd
-
-